﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace WebGioiThieu.Models
{
    public class PageInfo
    {
        public int TotalPage
        {
            get
            {
                return
                    (int)(TotalItem / PageSize) + (TotalItem % PageSize == 0 ? 0 : 1);
            }
        }
        public int TotalItem { get; set; }
        public int PageSize { get; set; }
        public int Current { get; set; }
        public string Url { get; set; }
        public int Next { get { return (Current == Last)? -1: (Current + 1) ; } }
        public int Preview { get{ return (Current == Frist)? -1: (Current - 1) ; } }
        public int Frist { get { return 1; } }
        public int Last { get { return TotalPage; } }
    }
}